package cn.tm.ms.memory.ds;

import java.util.Map;
import java.util.Properties;

import javax.sql.DataSource;

/**
 * 数据源
 * 
 * @author lry
 */
public interface Ids {

	/**
	 * 从配置文件加载数据源
	 * 
	 * @return
	 * @throws Throwable
	 */
	DataSource getDataSource() throws Throwable;
	
	/**
	 * 指定配置文件名称(classpath根目录下)加载数据源
	 * 
	 * @param propertiesName
	 * @return
	 * @throws Throwable
	 */
	DataSource getDataSource(String propertiesName) throws Throwable;
	
	/**
	 * 从Map加载数据源
	 * 
	 * @param properties
	 * @return
	 * @throws Throwable
	 */
	DataSource getDataSource(Map<String,Object> properties) throws Throwable;
	
	/**
	 * 从Properties文件加载数据源
	 * 
	 * @param properties
	 * @return
	 * @throws Throwable
	 */
	DataSource getDataSource(Properties properties) throws Throwable;
	
}
